import xadmin

from django.conf.urls import url, include, handler403, handler500
from django.views.generic import TemplateView
from django.views.static import serve
from mx.settings import MEDIA_ROOT
# from mx.settings import STATIC_ROOT
from apps.users.views import *


# 全局错误页面配置  DEBUG = False
# handler404 = "users.views.pageNotFound"
# handler500 = "users.views.pageError"


urlpatterns = [
    url(r'^$', IndexView.as_view(), name="index"),
    url(r'^xadmin/', xadmin.site.urls),
    url(r'^media/(?P<path>.*)$', serve, {"document_root": MEDIA_ROOT}),
    # url(r'^static/(?P<path>.*)$', serve, {'document_root': STATIC_ROOT}),
    #url(r'^regist/(?P<params>[toAdd|saveAdd]+)/$', UserAskView.guideRegist, name="guideRegist"),
    # url(r'^404/$', TemplateView.as_view(template_name="404.html"), name="404"),
    # url(r'^500/$', TemplateView.as_view(template_name="500.html"), name="500"),

    #第三方插件
    url(r'^ueditor/',include('DjangoUeditor.urls')),
    url(r'^captcha/', include('captcha.urls')),

    url(r'^users/', include('users.urls', namespace="users")),
    url(r'^courses/', include('courses.urls', namespace="courses")),
    url(r'^orgs/', include('organizations.urls', namespace="orgs")),
    url(r'^operations/', include('operations.urls', namespace="operations")),
]
